<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Redirect.aspx.cs" Inherits="_Redirect" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Microsoft Live SSO</title>

    <script language="javascript" type="text/javascript">    
	function postSlt( liveLogonUrl, slt )
	{
		var tempSpan = window.document.createElement( "span" );
		var formHtml = "<form method='POST' action='" + liveLogonUrl + "' id='SLT_Form' name='SLT_Form'";
		formHtml += ">";
		formHtml += "<input type='hidden' name='slt' value='" + slt + "'>";
		formHtml += "</form>";

		tempSpan.innerHTML = formHtml;
		window.document.body.appendChild( tempSpan );
		
		var formTag = window.document.getElementById( "SLT_Form" );
		if ( !formTag )
		{
			var formTags = window.document.getElementsByTagName( "form" );
			if ( formTags )
			{
				if ( formTags.length )
				{
					for ( var index = 0; index < formTags.length; index++ )
					{
						if ( formTags[ index ].id == "SLT_Form" )
						{
							formTag = formTags[ index ];
							break;
						}
					}
				}
				else if ( formTags.id == "SLT_Form" )
				{
					formTag = formTags;
				}
			}
		}
		if ( formTag )
		{
		    formTag.submit();
		}
	}
    </script>

</head>
<body>
    <form id="form1" runat="server">
        <div>
            <asp:Label ID="lblError" runat="server" Font-Bold="true" ForeColor="Red" Text=""></asp:Label></div>
    </form>
</body>
</html>
